using System;
using System.Collections.Generic;

namespace Pay.TO {
	/// <summary>
	/// 分页信息
	/// </summary>
	/// <typeparam name="T"></typeparam>
	[Serializable]
	public class PagedResult<T> {
		public PagedResult() { }
		public PagedResult(List<T> rows, int total, int page, int size) {
			this.rows = rows;
			this.total_result = total;
			this.page = page;
			this.size = size;
		}
		/// <summary>
		/// 当前页
		/// </summary>
		public int page { get; set; }
		/// <summary>
		/// 当页N条
		/// </summary>
		public int size { get; set; }
		/// <summary>
		/// 总页数
		/// </summary>
		public int total_pages {
			get {
				if (total_result % size == 0)
					return total_result / size;
				return total_result / size + 1;
			}
		}
		/// <summary>
		/// 总记录数
		/// </summary>
		public int total_result { get; set; }

		/// <summary>
		/// 返回分页记录数据
		/// </summary>
		public List<T> rows { get; set; }
	}

	/// <summary>
	/// 收款分页信息
	/// </summary>
	/// <typeparam name="T"></typeparam>
	[Serializable]
	public class ChargePage<T> : PagedResult<T> {
		/// <summary>
		/// 总实收金额
		/// </summary>
		public decimal amount { get; set; }
		/// <summary>
		/// 总支付金额
		/// </summary>
		public decimal pay_amount { get; set; }
	}

	/// <summary>
	/// 对账分页信息
	/// </summary>
	/// <typeparam name="T"></typeparam>
	[Serializable]
	public class ItpPage<T> : PagedResult<T> {
		/// <summary>
		/// 分润
		/// </summary>
		public decimal amount { get; set; }
		/// <summary>
		/// 高清
		/// </summary>
		public decimal merchant_amount { get; set; }
		/// <summary>
		/// 利润
		/// </summary>
		public decimal profit { get; set; }
	}
}
